var limsEquipScrap = Gikam.getPageObject({

    getEditListColumns: function () {
        return [{
            checkbox: true
        },{index: true}, Gikam.status.getBpmnColumn(limsEquipScrap.workflow.dbTable), {
            field: 'equipCode',
            title: 'T_LIMS_EQUIP_SCRAP.EQUIPCODE',
            type: 'link',
            width: 140,
        }, {
            field: 'ext$.fixedassetnum',
            title: 'T_LIMS_EQUIPMENT.FIXEDASSETNUM',
            width: 140,
        }, {
            field: 'equipName',
            title: 'T_LIMS_EQUIP_SCRAP.EQUIPNAME',
            width: 140,
        }, {
            field: 'ext$.equipclass',
            title: 'T_LIMS_EQUIPMENT.EQUIPCLASS',
            type: 'select',
            category: 'sys',
            firstBlank: false,
            param: {
                codeCategoryId: 'eqClass'
            },
            width: 140,
        }, {
            field: 'ext$.usedept',
            title: 'T_LIMS_EQUIPMENT.USEDEPT',
            width: 140,
        }, {
            field: 'ext$.location',
            title: 'T_LIMS_EQUIPMENT.LOCATION',
            width: 140,
        }, {
            field: 'reason',
            title: 'T_LIMS_EQUIP_SCRAP.REASON',
            editor: true,
            width: 140,
        }, {
            field: 'createdByName',
            title: 'T_LIMS_EQUIP_SCRAP.CREATEDBYNAME',
            width: 120
        }, {
            field: 'createdTime',
            title: 'T_LIMS_EQUIP_SCRAP.CREATEDTIME',
            width: 160,
            type: 'dateTime',
        }]
    },

    getBaseInfoFormFields: function () {
        return [{
            field: 'equipCode',
            title: 'T_LIMS_EQUIP_SCRAP.EQUIPCODE',
            validators: ['strLength[0,12]', 'notEmpty'],
            preInsert: true,
            type: 'choose',
            category: 'equipment',
            cleanable: false,
            single: true,
            onBeforeChoose: function () {
                return {
                    equipState_DIFFER: 'scrapped',
                    target_filter: encodeURI(JSON.stringify({
                        type: 'unassigned',
                        targetTable: 'T_LIMS_EQUIP_SCRAP',
                        targetMatchColumn: 'EQUIPMENTID',
                        thisMatchColumn: 'ID',
                    }))
                }
            },
            onAfterChoose: function (rows, index) {
                if (rows && rows[0]) {
                    this.setData({
                        equipmentId: rows[0].id,
                        equipCode: rows[0].equipCode,
                        equipName: rows[0].equipName
                    })
                }
            },
        }, {
            field: 'equipName',
            title: 'T_LIMS_EQUIP_SCRAP.EQUIPNAME',
            validators: ['strLength[0,150]', 'notEmpty'],
            editable: false,
            readonly: true,
            preInsert: true
        }, {
            field: 'reason',
            title: 'T_LIMS_EQUIP_SCRAP.REASON',
            validators: ['strLength[0,180]'],
            preInsert: true
        },]
    },

    getAuditListColumns: function () {
        return [{
            checkbox: true
        },{index: true}, Gikam.status.getBpmnColumn(limsEquipScrap.workflow.dbTable), {
            field: 'equipCode',
            title: 'T_LIMS_EQUIP_SCRAP.EQUIPCODE',
            type: 'link',
            width: 140,
        }, {
            field: 'ext$.fixedassetnum',
            title: 'T_LIMS_EQUIPMENT.FIXEDASSETNUM',
            width: 140,
        }, {
            field: 'equipName',
            title: 'T_LIMS_EQUIP_SCRAP.EQUIPNAME',
            width: 140,
        }, {
            field: 'ext$.equipclass',
            title: 'T_LIMS_EQUIPMENT.EQUIPCLASS',
            type: 'select',
            category: 'sys',
            firstBlank: false,
            param: {
                codeCategoryId: 'eqClass'
            },
            width: 140,
        }, {
            field: 'ext$.usedept',
            title: 'T_LIMS_EQUIPMENT.USEDEPT',
            width: 140,
        }, {
            field: 'ext$.location',
            title: 'T_LIMS_EQUIPMENT.LOCATION',
            width: 140,
        }, {
            field: 'reason',
            title: 'T_LIMS_EQUIP_SCRAP.REASON',
            width: 140,
        }, {
            field: 'createdByName',
            title: 'T_LIMS_EQUIP_SCRAP.CREATEDBYNAME',
            width: 120
        }, {
            field: 'createdTime',
            title: 'T_LIMS_EQUIP_SCRAP.CREATEDTIME',
            width: 160,
            type: 'dateTime',
        }]
    },

    getSearchListColumns: function () {
        return [{
            checkbox: true
        },{index: true}, Gikam.status.getBpmnColumn(limsEquipScrap.workflow.dbTable), {
            field: 'equipCode',
            title: 'T_LIMS_EQUIP_SCRAP.EQUIPCODE',
            type: 'link',
            width: 140,
        }, {
            field: 'ext$.fixedassetnum',
            title: 'T_LIMS_EQUIPMENT.FIXEDASSETNUM',
            width: 140,
        }, {
            field: 'equipName',
            title: 'T_LIMS_EQUIP_SCRAP.EQUIPNAME',
            width: 140,
        }, {
            field: 'ext$.equipclass',
            title: 'T_LIMS_EQUIPMENT.EQUIPCLASS',
            type: 'select',
            category: 'sys',
            firstBlank: false,
            param: {
                codeCategoryId: 'eqClass'
            },
            width: 140,
        }, {
            field: 'ext$.usedept',
            title: 'T_LIMS_EQUIPMENT.USEDEPT',
            width: 140,
        }, {
            field: 'ext$.location',
            title: 'T_LIMS_EQUIPMENT.LOCATION',
            width: 140,
        }, {
            field: 'reason',
            title: 'T_LIMS_EQUIP_SCRAP.REASON',
            width: 140,
        }, {
            field: 'createdByName',
            title: 'T_LIMS_EQUIP_SCRAP.CREATEDBYNAME',
            width: 120
        }, {
            field: 'createdTime',
            title: 'T_LIMS_EQUIP_SCRAP.CREATEDTIME',
            width: 160,
            type: 'dateTime',
        }]
    },

    baseUrl: IFM_CONTEXT + '/secure/basemodule/rm/equipment/equip-scraps',

    workflow: {
        dbTable: 'T_LIMS_EQUIP_SCRAP',
        columns: [{
            field: 'id',
            title: 'T_LIMS_EQUIP_SCRAP.ID'
        }]
    },

    /**
     * 审核记录
     */
    getFlowListColumns: function () {
        return [{
            index: true
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.CANDIDATOR.TASKNAME',
            field: 'taskName',
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.CANDIDATOR.USER',
            field: 'auditedByName'
        }, {
            title: 'T_CORE_INTERNAL_AUDIT.AUDITDATE',
            field: 'auditedTime',
            width: 140
        }, {
            title: 'GIKAM.WORKFLOW.PASS.OPINION.TITLE',
            field: 'comment',
            width: 300
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.COMMENT.ROUTE',
            field: 'route',
            width: 140
        }]
    },

})
